home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 August: Tool Chest / Dev.CD Aug 94.toast / Tool Chest / Interfaces / MPW Interfaces / PInterfaces / Graf3D.p < prev    next >
Encoding:
Text File  |  1993-09-17  |  2.3 KB  |  106 lines  |  [TEXT/MPS ]

  1. {
  2.     File:        Graf3D.p
  3.  
  4.     Copyright:    © 1983-1993 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Version:    System 7.1 for ETO #11
  8.     Created:    Tuesday, March 30, 1993 18:00
  9.  
  10. }
  11.  
  12. {$IFC UNDEFINED UsingIncludes}
  13. {$SETC UsingIncludes := 0}
  14. {$ENDC}
  15.  
  16. {$IFC NOT UsingIncludes}
  17.     UNIT Graf3D;
  18.     INTERFACE
  19. {$ENDC}
  20.  
  21. {$IFC UNDEFINED UsingGraf3D}
  22. {$SETC UsingGraf3D := 1}
  23.  
  24. {$I+}
  25. {$SETC Graf3DIncludes := UsingIncludes}
  26. {$SETC UsingIncludes := 1}
  27. {$IFC UNDEFINED UsingQuickdraw}
  28. {$I $$Shell(PInterfaces)Quickdraw.p}
  29. {$ENDC}
  30. {$SETC UsingIncludes := Graf3DIncludes}
  31.  
  32. CONST
  33. radConst = 3754936;
  34.  
  35. TYPE
  36. Point3D = RECORD
  37.     x: Fixed;
  38.     y: Fixed;
  39.     z: Fixed;
  40.     END;
  41.  
  42. Point2D = RECORD
  43.     x: Fixed;
  44.     y: Fixed;
  45.     END;
  46.  
  47. XfMatrix = ARRAY [0..3, 0..3] OF Fixed;
  48.  
  49. Port3DPtr = ^Port3D;
  50. Port3DHandle = ^Port3DPtr;
  51. Port3D = RECORD
  52.     grPort: GrafPtr;
  53.     viewRect: Rect;
  54.     xLeft: Fixed;
  55.     yTop: Fixed;
  56.     xRight: Fixed;
  57.     yBottom: Fixed;
  58.     pen: Point3D;
  59.     penPrime: Point3D;
  60.     eye: Point3D;
  61.     hSize: Fixed;
  62.     vSize: Fixed;
  63.     hCenter: Fixed;
  64.     vCenter: Fixed;
  65.     xCotan: Fixed;
  66.     yCotan: Fixed;
  67.     ident: BOOLEAN;
  68.     xForm: XfMatrix;
  69.     END;
  70.  
  71.  
  72. PROCEDURE InitGrf3d(port: Port3DHandle);
  73. PROCEDURE Open3DPort(port: Port3DPtr);
  74. PROCEDURE SetPort3D(port: Port3DPtr);
  75. PROCEDURE GetPort3D(VAR port: Port3DPtr);
  76. PROCEDURE MoveTo2D(x: Fixed;y: Fixed);
  77. PROCEDURE MoveTo3D(x: Fixed;y: Fixed;z: Fixed);
  78. PROCEDURE LineTo2D(x: Fixed;y: Fixed);
  79. PROCEDURE Move2D(dx: Fixed;dy: Fixed);
  80. PROCEDURE Move3D(dx: Fixed;dy: Fixed;dz: Fixed);
  81. PROCEDURE Line2D(dx: Fixed;dy: Fixed);
  82. PROCEDURE Line3D(dx: Fixed;dy: Fixed;dz: Fixed);
  83. PROCEDURE ViewPort(r: Rect);
  84. PROCEDURE LookAt(left: Fixed;top: Fixed;right: Fixed;bottom: Fixed);
  85. PROCEDURE ViewAngle(angle: Fixed);
  86. PROCEDURE Identity;
  87. PROCEDURE Scale(xFactor: Fixed;yFactor: Fixed;zFactor: Fixed);
  88. PROCEDURE Translate(dx: Fixed;dy: Fixed;dz: Fixed);
  89. PROCEDURE Pitch(xAngle: Fixed);
  90. PROCEDURE Yaw(yAngle: Fixed);
  91. PROCEDURE Roll(zAngle: Fixed);
  92. PROCEDURE Skew(zAngle: Fixed);
  93. PROCEDURE Transform(src: Point3D;VAR dst: Point3D);
  94. FUNCTION Clip3D(src1: Point3D;src2: Point3D;VAR dst1: Point;VAR dst2: Point): INTEGER;
  95. PROCEDURE SetPt3D(VAR pt3D: Point3D;x: Fixed;y: Fixed;z: Fixed);
  96. PROCEDURE SetPt2D(VAR pt2D: Point2D;x: Fixed;y: Fixed);
  97. PROCEDURE LineTo3D(x: Fixed;y: Fixed;z: Fixed);
  98.  
  99.  
  100. {$ENDC}    { UsingGraf3D }
  101.  
  102. {$IFC NOT UsingIncludes}
  103.     END.
  104. {$ENDC}
  105.  
  106.